{extend name='app' /}
{block name='title'}管理员日志{/block}

{block name="stylesheet"}
<link href="{__ADMIN__}/dist/src/supertables/css/tableStyle.css" rel="stylesheet">
<link href="{__ADMIN__}/dist/src/supertables/css/superTables.css" rel="stylesheet">
{/block}


{block name="breadcrumb"}
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-lg-10">
        <h2>管理员日志</h2>
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <a>权限管理</a>
            </li>
            <li class="breadcrumb-item active">
                <strong>管理员日志</strong>
            </li>
        </ol>
    </div>
</div>
{/block}


{block name="content"}
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-lg-12">
            <div class="ibox ">

                <form id="block-search">
                    <div class="row ">
                        <div class="col-sm-2">
                            <div class="form-group">
                                <label class="control-label">操作标题</label>
                                <select class="form-control m-b select-title" name="title">
                                    <option value="">请选择操作标题</option>
                                    <option value="登录行为" {if !empty($search.title) && $search.title==
                                    '登录行为'} selected {/if}>登录行为</option>
                                    <option value="操作行为" {if !empty($search.title) && $search.title==
                                    '操作行为'} selected {/if}>操作行为</option>
                                </select>
                            </div>
                        </div>
                    </div>

                    <div class="row m-b-lg">
                        <div class="col-sm btn-group-search">
                            <button class="btn btn-primary btn-sm" type="submit">确定</button>
                            <button class="btn btn-white btn-sm btn-reset" type="button">重置</button>
                        </div>
                    </div>
                </form>


                <div class="ibox-content">
                    <div class="row">
                        <div class="col-sm m-b-sm">

                                <span class="float-right btn-group">
                                    <button class="btn btn-white btn-sm btn-outline btn-search" type="button"><i
                                            class="fa fa-search"></i>&nbsp;搜索
                                    </button>
                                </span>
                        </div>
                    </div>

                    <div class="table-responsive">
                        <div style="height:100vh">
                            <table class="table table-bordered table-hover" id="table">
                                <tr>
                                    <td>#</td>
                                    <td>用户名</td>
                                    <td>操作标题</td>
                                    <td>内容</td>
                                    <td>路由</td>
                                    <td>IP</td>
                                    <td>结果</td>
                                    <td>浏览器</td>
                                    <td>执行时间</td>
                                    <td>操作</td>
                                </tr>
                                {foreach $list as $index => $item}
                                <tr>
                                    <td>{++$index}</td>
                                    <td>{$item->account->account_name}</td>
                                    <td>{$item->title}</td>
                                    <td>{$item->content}</td>
                                    <td>{$item->route}</td>
                                    <td>{$item->ip}</td>
                                    <td>{$item->outcome == 'success' ? $item->outcome : 'fail'}</td>
                                    <td> {php} echo explode(' (',$item->useragent)[0]; {/php}</td>
                                    <td>{$item->create_time}</td>
                                    <td>
                                        <button class="btn btn-success btn-xs" type="button"
                                                onclick="get_html($(this),'{$Think.config.admin.app_host}/admin/operation/{$item->id}')">
                                            <i class="fa fa-list-alt"></i>&nbsp;详情
                                        </button>
                                    </td>
                                </tr>
                                {/foreach}
                            </table>
                        </div>
                        <div class="float-right">
                            {$list|raw}
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>
{/block}

{block name="script"}
<script src="{__ADMIN__}/dist/src/supertables/js/superTables.js"></script>
<script>

    window.onload = function () {
        new superTable("table", {
            cssSkin: "sDefault",
            fixedCols: 1, //固定几列
            headerRows: 1,  //头部固定行数
            onStart: function () {
                this.start = new Date();
            },
            onFinish: function () {
            }
        });


        $(".sData").css("height", "100vh");

    }
</script>
{/block}
